#!/usr/bin/env bash
# Runs the compiled program, building it first on a clean checkout.
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ ! -x "$root/build/app" ]; then
  ( cd "$root" && mkdir -p build && mlton -output build/app app.mlb >&2 )
fi
exec "$root/build/app" "$@"
